/**
 * Project oo_thread
 */


#include "ConsumerThread.h"
#include <iostream>
using std::endl;
using std::cout;
/**
 * ConsumerThread implementation
 */


/**
 * @param taskQue
 */
ConsumerThread::ConsumerThread(TaskQueue & taskQue)
:_taskQue(taskQue)
{

}

/**
 * @return void
 */
void ConsumerThread::run() {
     int cnt = 20;
        while(cnt-- > 0) {
            //从任务队列中获取数据
            int num = _taskQue.pop();
            cout << "consume :" << num << endl;
            //sleep(1);
        }
}
